# Contributor: Thomas Kienlen <kommander@laposte.net>
# Maintainer: Thomas Kienlen <kommander@laposte.net>
pkgname=gufw
pkgver=24.04
pkgrel=1
pkgdesc="GUI for Uncomplicated Firewall"
url="https://costales.github.io/projects/gufw/"
arch="noarch"
options="!check" # no test suite
license="GPL-3.0-or-later"
depends="
	desktop-file-utils
	gtk-update-icon-cache
	polkit
	py3-gobject3
	python3
	ufw
	webkit2gtk
	"
makedepends="
	intltool
	py3-distutils-extra
	py3-setuptools
	"
source="https://github.com/costales/gufw/archive/$pkgver/gufw-$pkgver.tar.gz"
subpackages="$pkgname-doc $pkgname-lang $pkgname-pyc"

build() {
	local PYTHONVERSION="$(python3 -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')"
	sed \
		-e 's|/usr/share/gufw/gufw/gufw.py $1|/usr/lib/python'"$PYTHONVERSION"'/site-packages/gufw/gufw.py "$@"|' \
		-e 's|/bin/bash|/bin/sh|' \
		-i bin/gufw-pkexec
	sed \
		's|/bin/bash|/bin/sh|' \
		-i bin/gufw
	python3 setup.py build
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir" -O1
}

sha512sums="
c9b9d86c35ab574e6e93f3dc62fc1875c33b371c397ab7032e07935db7d594c7e0af37789678007b848ff83a5d1d69724c728687c0c36a4c890aaf56420c2228  gufw-24.04.tar.gz
"
